﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using WinFormsUI.Docking;
using SMK_Treeview;
using Forms.DockHelpers;

namespace SMK_Explorer_2013.Forms.DockHelpers
{
    /// <summary>
    /// 
    /// </summary>
    public partial class Explorer_Helper : ToolWindow
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="key"></param>
        public delegate void TreeviewSelected(object sender, Treeview_Properties key);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="servername"></param>
        public delegate void ServerAdded(string servername);

        /// <summary>
        /// 
        /// </summary>
        public event TreeviewSelected tvs;
        /// <summary>
        /// 
        /// </summary>
        public event ServerAdded tvserveradded;
        /// <summary>
        /// 
        /// </summary>
        public Explorer_Helper()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected override void OnRightToLeftLayoutChanged(EventArgs e)
        {
           this.treeview1.RightToLeftLayout = RightToLeftLayout;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="key"></param>
        private void treeview1_tvs(object sender, SMK_Treeview.Treeview_Properties key)
        {
            tvs(sender, key);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="servername"></param>
        private void treeview1_tvserveradded(string servername)
        {
            tvserveradded(servername);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="Servername"></param>
        /// <param name="connectionType"></param>
        public void Addserver(string Servername, string connectionType)
        {
            this.treeview1.Addserver(Servername, connectionType);
        }

    }
}
